home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / apps.to.go / Kibitz / Kibitz.protos < prev    next >
Encoding:
Text File  |  1994-05-06  |  7.7 KB  |  265 lines  |  [TEXT/MPS ]

  1. #ifndef __APPLETALK__
  2. #include <AppleTalk.h>
  3. #endif
  4.  
  5. #ifndef __LISTCONTROL__
  6. #include <ListControl.h>
  7. #endif
  8.  
  9. #ifndef __MENUS__
  10. #include <Menus.h>
  11. #endif
  12.  
  13. #ifndef __STANDARDFILE__
  14. #include <StandardFile.h>
  15. #endif
  16.  
  17.  
  18.  
  19. typedef pascal Boolean    (*GRPTProcPtr)(LocationNamePtr locationName, PortInfoPtr thePortInfo);
  20.  
  21.  
  22.  
  23. /************** AEchess.c **************/
  24.  
  25. void            InitCustomAppleEvents(void);
  26. pascal OSErr    DoAEAnswer(AppleEvent *message, AppleEvent *reply, long refcon);
  27. OSErr            SendGame(FileRecHndl frHndl, short sendReason, StringPtr nbpType);
  28. pascal OSErr    ReceiveGameReply(AppleEvent *message, AppleEvent *reply);
  29. pascal OSErr    ReceiveGame(AppleEvent *message, AppleEvent *reply, long refcon);
  30. Boolean            SendMssg(FileRecHndl frHndl, short messageType);
  31. pascal OSErr    ReceiveMssg(AppleEvent *message, AppleEvent *reply, long refcon);
  32. WindowPtr        GetGameWindow(long gameID_0, long gameID_1);
  33. pascal Boolean    KibitzPortFilter(LocationNamePtr locationName, PortInfoPtr thePortInfo);
  34. void            SetOpponentType(FileRecHndl frHndl, short newOpponentType);
  35. OSErr            GetRemoteProcessTarget(FileRecHndl frHndl, AEDesc *retDesc, GRPTProcPtr proc);
  36. pascal Boolean    FinderFilter(LocationNamePtr locationName, PortInfoPtr thePortInfo);
  37. pascal Boolean    KibitzFilter(LocationNamePtr locationName, PortInfoPtr thePortInfo);
  38.  
  39.  
  40.  
  41. /************** AppleEvents.c **************/
  42.  
  43. void            InitAppleEvents(void);
  44. pascal OSErr    KibitzAEOpenApplication(AppleEvent *message, AppleEvent *reply, long refcon);
  45. pascal OSErr    KibitzAEOpenDocuments(AppleEvent *message, AppleEvent *reply, long refcon);
  46. pascal OSErr    KibitzAEPrintDocuments(AppleEvent *message, AppleEvent *reply, long refcon);
  47. pascal OSErr    KibitzAEQuitApplication(AppleEvent *message, AppleEvent *reply, long refcon);
  48. OSErr            OpenDocEventHandler(AppleEvent *message, AppleEvent *reply, short mode);
  49.  
  50.  
  51.  
  52. /************** AppleTalk.c **************/
  53.  
  54. OSErr            DoBuildZoneList(ListHandle listHndl);
  55. OSErr            DoSelectMyZone(ListHandle listHndl);
  56. OSErr            AddPPCNBPAlias(NamesTableEntry *theNTE, Str32 newNBPType, EntityName *newEntity);
  57. OSErr            RemoveNBPAlias(EntityPtr theEntity);
  58.  
  59.  
  60.  
  61. /************** BoardSlider.c **************/
  62.  
  63. void            AdjustGameSlider(FileRecHndl frHndl);
  64. ControlHandle    BoardSliderNew(WindowPtr window);
  65. Boolean            RepositionBoard(FileRecHndl frHndl, short newPos, Boolean update);
  66.  
  67.  
  68.  
  69. /************** Chess.c **************/
  70.  
  71. void            NewGame(FileRecHndl game);
  72. void            GenerateLegalMoves(FileRecHndl game);
  73. void            AddLegalMove(FileRecHndl game, short from, short to);
  74. Boolean            CastleOkay(FileRecHndl game, short castleSide);
  75. void            MakeMove(FileRecHndl game, short moveFrom, short moveTo, short promoteTo);
  76. void            UnmakeMove(FileRecHndl game);
  77. short            SquareAttacked(FileRecHndl game, short square, short color);
  78. void            EndTheGame(FileRecHndl game, short endReason);
  79. short            WhosMove(FileRecHndl game);
  80. void            CalcPositionValues(FileRecHndl game);
  81. short            GameStatus(FileRecHndl game);
  82. short            UpdateTime(FileRecHndl game, Boolean canLose);
  83. void            UpdateGameStatus(FileRecHndl game);
  84. void            DrawButtonTitle(FileRecHndl game, short newVal);
  85. void            SlideThePiece(FileRecHndl game, short fromSq, short toSq);
  86. OSErr            InitLogic(void);
  87. Boolean            ComputerMove(FileRecHndl game);
  88. short            BestMove(FileRecHndl game);
  89. long            OneDeepEval(FileRecHndl game, short from, short to, short color);
  90. short            CheckForMate(FileRecHndl game, short nodeDepth, short maxDepth);
  91.  
  92. short            QueenMate(FileRecHndl game);
  93. short            RookMate(FileRecHndl game);
  94. void            GetRowCol(short pos, short *row, short *col);
  95. void            GetDeltas(short pos1, short pos2, short *dr, short *dc, short *absdr, short *absdc);
  96. void            RSpinPosition(short *pos);
  97. void            HFlipPosition(short *pos);
  98.  
  99.  
  100.  
  101. /************** Config.c **************/
  102.  
  103. void            DoConfigureGame(FileRecHndl frHndl);
  104.  
  105.  
  106.  
  107. /************** DoCursor.c **************/
  108.  
  109. void            DoCursor(void);
  110. void            DoSetCursor(Cursor *cursor);
  111. Rect            BoardRect(void);
  112. Rect            GlobalBoardRect(WindowPtr window);
  113.  
  114.  
  115.  
  116. /************** DoEvent.c **************/
  117.  
  118. short            AlertIfGameOver(FileRecHndl frHndl);
  119. void            DoActivate(WindowPtr window, Boolean becomingActive);
  120. void            DoContentClick(WindowPtr window, EventRecord *event);
  121. void            DoEvent(EventRecord *event);
  122. void            DoUpdate(WindowPtr window);
  123. pascal Boolean    statusFilter(DialogPtr dlg, EventRecord *event, short *item);
  124.  
  125.  
  126.  
  127. /************** EventLoop.c **************/
  128.  
  129. void            EventLoop(void);
  130.  
  131.  
  132.  
  133. /************** File.c **************/
  134.  
  135. OSErr            AppDisposeDocument(FileRecHndl frHndl);
  136. Boolean            AppDocumentDirty(FileRecHndl frHndl);
  137. OSErr            AppNewDocument(FileRecHndl *returnHndl, short winNameType);
  138. OSErr            AppOpenDocument(FileRecHndl *result, FSSpecPtr fileToOpen, char permission);
  139. OSErr            AppSaveDocument(FileRecHndl    frHndl, WindowPtr window, short saveMode);
  140. void            ConvertOldToNewSFReply(SFReply *oldReply, StandardFileReply *newReply);
  141. OSErr            Create_OpenFile(FSSpec *file, short *refNum, OSType theFileType);
  142. Boolean         DisplayGetFile(StandardFileReply *reply);
  143. Boolean         DisplayPutFile(StandardFileReply *reply);
  144. void            IncNewFileNum(Boolean flag);
  145.  
  146. OSErr            AppReadDocument(FileRecHndl frHndl, OSType ftype);
  147. OSErr            AppWriteDocument(FileRecHndl frHndl);
  148. OSErr            AppDuplicateDocument(FileRecHndl oldFrHndl, FileRecHndl *newFrHndl);
  149. OSErr            AppAutoLaunch(FileRecHndl frHndl);
  150.  
  151.  
  152.  
  153. /************** GoToMove.c **************/
  154.  
  155. void            DoGoToMove(FileRecHndl frHndl);
  156.  
  157.  
  158.  
  159. /************** Help.c **************/
  160.  
  161. void            DynamicBalloonHelp(void);
  162.  
  163.  
  164.  
  165. /************** IdleTasks.c **************/
  166.  
  167. void            DoIdleTasks(Boolean allowComputerMoves);
  168.  
  169.  
  170.  
  171. /************** Init.c **************/
  172.  
  173. void            Initialize(void);
  174. void            StartDocuments(void);
  175.  
  176.  
  177.  
  178. /************** KibitzWindow.c **************/
  179.  
  180. OSErr            AppNewWindowControls(FileRecHndl frHndl, WindowPtr window, WindowPtr behind);
  181. void            DrawTime(FileRecHndl frHndl);
  182. void            ImageBoardLines(short increment, short hOffset, short vOffset);
  183. void            ImageDocument(FileRecHndl frHndl, Boolean justBoard);
  184. void            ImageMoveList(FileRecHndl frHndl, Rect theInk, short hOffset);
  185.  
  186.  
  187.  
  188. /************** Menu.c **************/
  189.  
  190. void            AdjustMenus(void);
  191. void            DoMenuCommand(long menuResult, EventRecord *event);
  192. void            EnableOrDisableItem(MenuHandle menu, short item, Boolean enable);
  193.  
  194.  
  195.  
  196. /************** Notation.c **************/
  197.  
  198. Boolean            AnnotateMove(FileRecHndl frHndl, short printMoveNum, short gameIndex, StringPtr pstr);
  199. void            MovesToOutBox(FileRecHndl frHndl, EventRecord *event);
  200. void            MovesFromText(FileRecHndl frHndl, Handle txt, short len,
  201.                               short beg, short end, Boolean slideMoves);
  202. void            MakeVerbose(FileRecHndl frHndl, StringPtr pstr);
  203. void            SayTheMove(FileRecHndl frHndl);
  204.  
  205.  
  206.  
  207. /************** Offscreen.c **************/
  208.  
  209. OSErr            InitOffscreen(void);
  210. void            MoveThePiece(FileRecHndl frHndl, short fromSq, Rect fromRect, Point fromLoc, Point *toLoc);
  211.  
  212.  
  213.  
  214. /************** Print.c **************/
  215.  
  216. OSErr            AppPrintDocument(FileRecHndl frHndl, Boolean jobDlg, Boolean firstJob);
  217. OSErr            PresentStyleDialog(FileRecHndl frHndl);
  218.  
  219.  
  220.  
  221. /************** SaveBoardImage.c **************/
  222.  
  223. OSErr            SaveBoardImage(FileRecHndl frHndl);
  224.  
  225.  
  226.  
  227. /************** Setup.c **************/
  228.  
  229. void            DoArrangeBoard(FileRecHndl frHndl, EventRecord *event, Point clickLoc);
  230. void            DrawPalette(FileRecHndl frHndl);
  231. Rect            PaletteRect(void);
  232.  
  233.  
  234.  
  235. /************** Sound.c **************/
  236.  
  237. OSErr            RecordSound(FileRecHndl frHndl);
  238. Boolean            SoundInputAvaliable(void);
  239.  
  240.  
  241.  
  242. /************** SpeechMessage.c **************/
  243.  
  244. Boolean            SpeechAvailable(void);
  245. OSErr            SayText(TEHandle teH, Handle txt, VoiceSpec theVoice);
  246.  
  247.  
  248.  
  249. /************** Start.c **************/
  250.  
  251. void            main(void);
  252.  
  253.  
  254.  
  255. /************** Window.c **************/
  256.  
  257. OSErr            AppNewWindow(FileRecHndl frHndl, WindowPtr *retWindow, WindowPtr behind);
  258. void            AppNewWindowTitle(WindowPtr window);
  259. Boolean            AppWindowDirty(WindowPtr window);
  260. Boolean            CloseAllWindows(void);
  261. Boolean            CloseOneWindow(WindowPtr window, short saveMode);
  262. WindowPtr        SetFilePort(FileRecHndl frHndl);
  263.  
  264.  
  265.